<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>
<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="java.util.*" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title></title>

<script type="text/javascript" src="<%=root %>/js/jquery-1.3.2.min.js" charset="utf-8">//ADCRM</script>


<script language="javascript" type="text/javascript">

	$(function(){

		$.ajaxSetup ({
		    cache: false //关闭AJAX相应的缓存
		});

		$("#subChannel").load("newsactivity_subChannel.jsp");
		

		});


	function changeChannel(channelId){

		$.get("newsactivity_subChannel.jsp", { channelId: channelId },
				  function(data){
					$("#subChannel").html(data);
				  });

	}

</script>

</head>

<body>


<div class="tab_box">
	<div class="tab_menu">
    	<a href="newsactivity_create.jsp"  class="current">发布新闻和活动</a>
    	<a href="newsactivity_manager.jsp">管理新闻和活动</a>
    </div>
    <div class="tab_submenu">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="50%">&nbsp;</td>
          <td align="right"><strong><a href="#">预览</a><a href="#">打印</a><a href="#">导出</a></strong></td>
        </tr>
      </table>
    </div>
</div>

<div><%=new RequestUtil(request).getMsg() %></div>

<form name="newsactivityForm" id="newsactivityForm" action="<%=root %>/memberBackend/newsactivityCreate.do" method="post"
	enctype="multipart/form-data">

  <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">

    <tr>
      <td width="100" height="28" align="right">新闻标题：</td>
      <td><label>
        <input name="title" type="text" id="title" size="97" />
      </label></td>
    </tr>
    <tr>
      <td height="28" align="right">上传图片：</td>
      <td><label>
        <input type="file" name="file" id="fileField" />
      </label></td>
    </tr>
    <tr>
      <td height="28" align="right">所属大类：</td>
      <td><label>
        <select name="channelId" id="select" onchange="changeChannel(this.value)">
        
        	<option value="0">请选择</option>
        
        <%
        	//获得所有分类为“新闻获得” 频道列表
        	ChannelService cs=new ChannelServiceImpl();
        
        	List list=cs.getAllPrimaryChannelByType("01");
        	
        	if(list==null) list=new ArrayList();
        	
        	Channel channel=null;
        	
        	for(int i=0;i<list.size();i++){
        		
        		channel=(Channel)list.get(i);
        %>
        <option value="<%=channel.getId() %>"><%=channel.getName() %></option>
        <%
        		
        	}
        
        %>
        </select>
      </label></td>
    </tr>
    <tr>
      <td height="28" align="right">所属小类：</td>
      <td id="subChannel"></td>
    </tr>
    <tr>
      <td height="28" align="right">作者名称：</td>
      <td><label>
        <input name="author" type="text" size="50"  value="" />
      </label></td>
    </tr>
    
     <tr>
      <td height="28" align="right">作者描述：</td>
      <td><label>
        <TEXTAREA NAME="authorSum" ROWS="5" COLS="100"></TEXTAREA>
      </label></td>
    </tr>
    
    <tr>
      <td  align="right" valign="top">文章内容：</td>
      <td><label>
      <FCK:editor instanceName="context" height="500">
		    <jsp:attribute name="value">
		    您的内容…..
		    </jsp:attribute>
  	  </FCK:editor>
  	
      </label></td>
    </tr>
  </table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="td_updown">
    <tr>
      <td height="40" align="center">
      	<input type="submit" value="提交"/>
        <input type="reset" value="取消" /></td>
    </tr>
  </table>
</form>

<%= new RequestUtil(request).getMsg() %>
</body>
</html>
